<?php
declare (strict_types = 1);
namespace security\encoder;

/**
 * 
 */
class Md5PasswordEncoder implements PasswordEncoder {

    /**
     * 加密
     */
    public function encode($password, $options = []): string {
        if(isset($options['salt'])) {
            return md5($password . md5($options['salt']));
        } else {
            return md5($password);
        }
    }
}